﻿using CrystalDecisions.ReportAppServer.DataDefModel;
using CrystalDecisions.Shared;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using System.Data.OleDb;
using System.Data.SqlClient;
using CrystalDecisions.CrystalReports.Engine;

namespace So_Tu_Phap.module.khai_sinh
{
    public partial class test_rp : Form
    {
        public test_rp()
        {
            InitializeComponent();
            ReportDocument cryRpt = new ReportDocument();
            cryRpt.Load(@"C:\DB ACCESS/GiayKhaiSinhMMBS.rpt");
            cryRpt.SetDataSource(CMSUtils.GetDataSQL("", "dbo_VW_KhaiSinh", "*", "maks =  '15007110000000000'", ""));

            ParameterValues crParameterValues = new ParameterValues();
            ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();

            crParameterDiscreteValue.Value = "dddddddddddddd";
            ParameterFieldDefinitions PR_NgayBangChus = cryRpt.DataDefinition.ParameterFields;
            ParameterFieldDefinition PR_NgayBangChu = PR_NgayBangChus["PR_NgayBangChu"];
            crParameterValues = PR_NgayBangChu.CurrentValues;
            crParameterValues.Clear();
            crParameterValues.Add(crParameterDiscreteValue);
            PR_NgayBangChu.ApplyCurrentValues(crParameterValues);

            crystalReportViewer1.ReportSource = cryRpt;
            crystalReportViewer1.Refresh();
        }
    }
}
